// 页面跳转
export const linkPage = {
  data() {
    return {}
  },
  methods: {
    // 待办任务跳转统一处理逻辑   只有刷新页面和点击重置时清空传参。其他情况保留待办任务的参数
    linkPageFun(row) {
      console.log('zmm ~ file: link.js:9 ~ linkPageFun ~ this.$route.name:', this.$route.name)

      switch (row.taskType) {
        case 12: // 跳转客户页 [12, 13] 客户批注
          this.$router.push({
            name: 'allCustomers',
            params: {
              customerListFormStatistics: [row.businessId]
            }
          })
          break
        case 13: // 跳转客户页
          this.$router.push({
            name: 'allCustomers',
            params: {
              customerListFormStatistics: [row.businessId]
            }
          })
          break
        case 14: //14认购附件审核  [14, 15]附件审核
          this.$router.push({
            name: 'subEnclose',
            params: {
              businessId: Number(row.businessId),
              showTab: row.eventType == 'deal' ? '1' : '2'
            }
          }) // 认购附件审核
          break
        case 15: // 15签约附件审核[14, 15]附件审核
          this.$router.push({
            name: 'contractEnclose',
            params: {
              businessId: Number(row.businessId),
              showTab: row.eventType == 'deal' ? '1' : '2'
            }
          }) // 签约附件审核
          break
        case 10: //回款审核 [10]
          this.$router.push({
            name: 'paymentArrival',
            params: {
              receiptRecordId: row.moneyBackId
            }
          }) //回款审核
          break
        case 9: //签约审核 [9]
          this.$router.push({
            name: 'contractOrder',
            params: {
              orderCode: row.qyCode
            }
          }) //签约审核
          break
        case 8: // 认购审核 [8]
          this.$router.push({
            name: 'subscriptionOrder',
            params: {
              orderCode: row.rgCode
            }
          }) //认购订单
          break
        case 16: //[16]案场状态维护
          this.$router.push({
            name: 'buildingConfigure',
            params: {
              fromCustomer: 'basicInformation',
              type: row.eventType
            }
          })
          break
        case 17: //[17, 18]营销信息维护 // 17 置业计划书维护
          this.$router.push({
            name: 'articleManagement',
            params: {
              type: row.eventType
            }
          })
          break
        case 18: //[17, 18]营销信息维护 // 18线上售楼处
          this.$router.push({
            name: 'buildingDetail',
            params: {
              type: row.eventType
            }
          })
          break
        case 20: // [20]霸屏神器维护
          this.$router.push({
            name: 'shortArticle'
          })
          break
        case 21: //[21, 22] 人员异动维护 // 21 人员异动
          this.$router.push({
            name: 'teamList',
            params: {
              userId: this.taskStatus == 2 || this.taskStatus == 5 ? '' : row.businessId,
              openCallIn: row.openCallIn,
              curTab: 'onCase'
            }
          })
          break
        case 22: //[21, 22] 人员异动维护 // 21 人员离职
          this.$router.push({
            name: 'teamList',
            params: {
              openCallIn: row.openCallIn,
              userId: row.businessId,
              flag: 'leaveOffice',
              curTab: this.taskStatus == 2 || this.taskStatus == 5 ? 'leaveCase' : 'onCase'
            }
          })
          break
        case 23: //[23]线索分配
          this.$router.push({
            name: 'clueAssign',
            params: {
              isMaskPhone: row.isMaskPhone, // 是否是隐私号
              clueCustomerList: this.taskStatus == 1 || this.taskStatus == 3 ? [Number(row.businessId)] : [],
              isOpenModal: this.taskStatus == 1 || this.taskStatus == 3 ? true : false
            }
          })
          break
        case 35: //[35]案场日报维护
          this.$router.push({
            name: 'dailyPaper',
            params: {
              isDefaultEdit: row.eventType == 'deal' ? true : false
            }
          })
          break
        case 31: //[31]我司盖章附件上传
          this.$router.push({
            name: 'initiate',
            params: {
              businessId: row.businessId
            }
          })
          break
        case 34: //[34] 线上售楼处审核
          if (row.eventType == 'deal') {
            this.$router.push({
              name: 'buildingCheckcenterFirst'
            })
          } else {
            this.$router.push({
              name: 'buildingDetail'
            })
          }
          break
        case 33: //[33] 置业计划书素材审核
          this.$router.push({
            name: 'articleReview',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 25: //[25] 退购单审核
          this.$router.push({
            name: 'returnPurchase',
            params: {
              businessId: [row.businessId],
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 26: //退签单审核 [26]
          this.$router.push({
            name: 'returnNote',
            params: {
              businessId: [row.businessId],
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 27: //[27]请佣单确认
          this.$router.push({
            name: 'information',
            params: {
              businessId: row.businessId
            }
          })
          break
        case 28: //[28] 请佣单附件上传及时（甲方签收发票回执）
          this.$router.push({
            name: 'information',
            params: {
              businessId: row.businessId
            }
          })
          break
        case 29: //[29] 请佣单附件上传及时（甲方盖章附件）
          this.$router.push({
            name: 'information',
            params: {
              businessId: row.businessId
            }
          })
          break
        case 30: //[30]佣金回款附件上传及时（银行回单附件）
          this.$router.push({
            name: 'payment',
            params: {
              businessId: row.businessId
            }
          })
          break
        case 32: //[32]请佣单回款核销任务
          if (row.eventType == 'deal') {
            this.$router.push({
              name: 'information',
              params: {
                settlementStatuses: ['NO_WRITE_OFF', 'WRITING_OFF']
              }
            })
          } else {
            this.$router.push({
              name: 'payment',
              params: {
                businessId: row.businessId
              }
            })
          }
          break
        case 36: //[36]线索目标设定
          this.$router.push({
            name: 'buildingConfigure',
            params: {
              fromCustomer: 'targetManagement',
              currentTab: 'CLUETARGET'
            }
          })
          break
        case 38: //[38]来人目标设定
          this.$router.push({
            name: 'buildingConfigure',
            params: {
              fromCustomer: 'targetManagement',
              currentTab: 'VISITOR'
            }
          })
          break
        case 39: //[39]认购目标设定
          this.$router.push({
            name: 'buildingConfigure',
            params: {
              fromCustomer: 'targetManagement',
              currentTab: 'SUBSCRIPTION'
            }
          })
          break
        case 40: //[40]签约目标设定
          this.$router.push({
            name: 'buildingConfigure',
            params: {
              fromCustomer: 'targetManagement',
              currentTab: 'CONTRACT'
            }
          })
          break
        case 101: //[101]非特殊奖金单审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'billApproval' : 'caseBillApproval',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 102: //[102]非特殊奖金单截止日期审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'billApproval' : 'caseBillApproval',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 103: //[103]在销激励审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'incentiveApprove' : 'caseIncentiveApprove',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 104: //[104]在销激励截止日期审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'incentiveApprove' : 'caseIncentiveApprove',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 105: //[105]项目津贴审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'allowanceApprove' : 'caseAllowanceApprove',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 106: //[106]项目津贴截止日期审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'allowanceApprove' : 'caseAllowanceApprove',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 107: //[107]特殊奖金审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'billApproval' : 'caseBillApproval',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        case 108: //[108]特殊奖金截止日期审核
          this.$router.push({
            name: this.$route.name == 'taskListPageWork' ? 'billApproval' : 'caseBillApproval',
            params: {
              businessId: row.businessId,
              tabCheck: row.eventType == 'deal' ? '0' : row.auditState == 3 ? '1' : '2'
            }
          })
          break
        default:
          break
      }
    }
  }
}
